import request from '@/utils/request.js'
import {} from '@/utils/token'

// 注册
export function register(userinfo) {
  return request({
    url: '/user/register',
    method: 'post',
    data: {
      account:userinfo.username,
      password:userinfo.password
    }
  })
}
// 登录
export function login(userinfo) {

  return request({
    url: '/user/login',
    method: 'post',
    data: {
      account:userinfo.uname,
      password:userinfo.pass
    }
  })
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/user/getCurrentUserInfo',
    method: 'get'
  })
}
// 更新用户
export function updateuser(data) {
  return request({
    url: '/user/updateUserInfo',
    method: 'post',
    data
  })
}
// 更改用户密码
export function updatepass(data) {
  return request({
    url: '/user/updateUserPass',
    method: 'post',
    data
  })
}

// 更改用户头像
export function updateavator(urls) {
  return request({
    url: `/user/updateUserAvatar?url=${urls}`,
    method: 'post',
  })
}




